import httpUtil  from './httpUtil'

export default {
  //全局定义的url变量
  url: '/graphs/',
  //查询列表
  list () {
    return httpUtil.fetch({
      url: '/list_All',
      // url: this.url,
      method: 'get'
    });
  },
  //编辑组态
  detail (id) {
    return httpUtil.fetch({
      url: '/detail_Graph/' + id,
      // url: this.url + id,
      method: 'get'
    });
  },
  create (data) {
    return httpUtil.fetch({
      // url: `${this.url}`,
      url: this.url,
      method: 'post',
      data
    });
  },
  update (data) {
    return httpUtil.fetch({
      url: this.url,
      method: 'put',
      data
    });
  },
  //删除
  delete (id) {
    return httpUtil.fetch({
      url: `delete_Graph/${id}`,
      // url: `${this.url}${id}`,
      method: 'delete'
    });
  }
}